#!/usr/bin/env bash

start() {
    local n="$1"
    ip link add e$n address 00:00:00:00:01:$n type veth \
        peer name t$n address 00:00:00:00:aa:$n
    ip addr add 10.0.0.$n/24 dev t$n
    ip link set e$n up
    ip link set t$n up
}

stop() {
    local n="$1"
    ip link del e$n
}

if [ "$1" ]; then $@; else echo "Usage: $0 <command> <node>"; fi
